home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1998 June / Macworld (1998-06).dmg / Shareware World / Comms & Internet / MT-NewsWatcher 2.4.4 / MT-NW AppleEvent support < prev    next >
Text File  |  1998-04-05  |  5KB  |  121 lines

  1. MT-NewsWatcher Apple Event support
  2. ----------------------------------
  3.  
  4. This is preliminary documentation of MT-NewsWatcher's Apple Event support, which
  5. you can expect to become more comprehensive in future versions. Note that
  6. MT-NW also supports shared menus, so that applications like URL Manager Pro
  7. and Frontier can add a menu to MT-NW's menu bar.
  8.  
  9. To see which events MT-NewsWatcher supports, use the "Open Dictionary" command
  10. in your script editor, and select the MT-NW application to open.
  11.  
  12. If you are interested in futher Apple Event support, and have suggestions
  13. for events to support, please send them to me at <mailto:smfr@best.com>.
  14.  
  15. Supported Apple Event suites
  16. ----------------------------
  17.  
  18. • Required suite
  19.  
  20. MT-NewsWatcher supports the required Apple Event suite, which consists of
  21. events to open the application, open documents, print documents and quit.
  22. This suite is supported by most Macintosh applications.
  23.  
  24. • Get URL suite
  25.  
  26. The URL suite is used for URL dispatching. MT-NewsWatcher can handle
  27. mailto: and news URLs.
  28.  
  29. nntp: URLs are handled, but are being phased out and should not be used.
  30.  
  31. news: URLs are handled, and take the form:
  32.  
  33.     news:groupname
  34.     news:message-ID
  35.     news://server/message-ID
  36.     news://server/groupname/
  37.  
  38. MT-NewWatcher can open single articles from another server (the 3rd form above),
  39. but cannot currently open a news group from a server that is not the one set in
  40. the preferences.
  41.  
  42. mailto: URLs of the form
  43.     <mailto:smfr@best.com?subject=MT%20NewsWatcher%20is%20cool&body=Hi%20there>
  44.  
  45. are handled properly.
  46.  
  47. MT-NewsWatcher dispatches URLs which are not nntp, news or mailto to the URL
  48. helpers as set in the preferences. It can also be configured to dispatch mailto:
  49. URLs to your preferred email application.
  50.  
  51. • YA-NewsWatcher suite
  52.  
  53. As of version 2.4.4, MT-NW supports the YA-NewsWatcher Apple Event suite.
  54. This provides events to read the contents of article windows, and to
  55. read and write the contents of message windows. You cannot change read-only
  56. headers in message windows (e.g. from, references, message-ID etc.).
  57.  
  58. The YA-NewsWatcher suite was first implemented in YA-NewsWatcher, by Brian Clark.
  59.  
  60. getmessage: Get the text of a message (i.e. outgoing), specifying the header or body.
  61.     getmessage 
  62.         messageField string --     The name of the header to return (e.g. “subject”, “Date”),
  63.                                 or an empty string to return the body text.
  64.         [windowName string] --     Name of the message window to get text from (or the top window)
  65.     Result: string          --     The requested text
  66.  
  67. setmessage: Set the text for a header or the body of an open message window. This will
  68.             replace existing text. You cannot set the text of non-editable headers.
  69.         setmessage string      --     The text to place in the body or header of the message window.
  70.                                 This replaces any existing text.
  71.         messageField string    --     Name of the header to reply (defaults to body text).
  72.         [windowName string]    --     Name of the open window to act on (default to topmost message window)
  73.  
  74. getarticle: Get the text of an open article window
  75.     getarticle 
  76.         messageField string --     The name of the header for which to return data, or an empty
  77.                                 string to return the body text.
  78.         [windowName string] --     Name of the window to get text from. Defaults to the frontmost
  79.                                 article window.
  80.     Result: string  -- The requested body or header text
  81.  
  82. Some examples (copy and paste into Script Editor to run):
  83.  
  84. -- get the subject of the frontmost article window
  85. tell application "MT-NewsWatcher 2.4.4"
  86.     getarticle messageField "subject"
  87. end tell
  88.  
  89. -- get the body text of the frontmost article window
  90. tell application "MT-NewsWatcher 2.4.4"
  91.     getarticle messageField "body"            -- can also use empty string to denoty body, or "full" for headers & body
  92. end tell
  93.  
  94. -- get the body of a named article window
  95. tell application "MT-NewsWatcher 2.4.4"
  96.     getarticle windowName "Re: System problem" messageField "body"
  97. end tell
  98.  
  99. -- get the subject of the frontmost message window
  100. tell application "MT-NewsWatcher 2.4.4"
  101.     getmessage messageField "subject"
  102. end tell
  103.  
  104. -- set the Reply-To header of the frontmost message window
  105. tell application "MT-NewsWatcher 2.4.4"
  106.     setmessage "my@email.address" messageField "reply-to"
  107. end tell
  108.  
  109. -- append a news group to the newsgroups header
  110. tell application "MT-NewsWatcher 2.4.4"
  111.     set currentGroups to getmessage messageField "newsgroups"
  112.     setmessage currentGroups & ", alt.test" messageField "newsgroups"
  113. end tell
  114.  
  115. The YA-NewsWatcher suite is used by a set of AppleScripts to improve interoperability with Eudora,
  116. called the Yadora package, by Andrew Starr. These can be used to copy an article directly to your
  117. Eudora inbox, and to make a nickname for the author of an article. The Yadora scripts are available
  118. at:
  119.     http://www.ka.net/eudora/mac/macfiles/yadora.sit
  120.     
  121.